
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="jquery-3.4.1.js"></script>
    <style>
        ul{
            list-style: none;
            background-color: rgb(228, 226, 226);
        }
        ul li{
            display: inline-block;
            padding: 10px 20px;
            cursor: pointer;
        }
        .item{
            display: none;
        }
    </style>
</head>
<body>
    <ul>
        <li>商品介绍</li>
        <li>规格与包装</li>
        <li>售后保障</li>
        <li>商品评价</li>
        <li>本店好评商品</li>
    </ul>
    <div>
        <div class="item">商品介绍</div>
        <div class="item">规格与包装</div>
        <div class="item">售后保障</div>
        <div class="item">商品评价</div>
        <div class="item">本店好评商品</div>
    </div>
    <script>
        $('li').click(function(){
            $(this).css({
                background:'red',
                color:'#fff'
            })
            .siblings().css({
                background:'',
                color:'#000'
            })
            $('.item').eq($('li').index($(this))).show().siblings().hide()
        })
    </script>
</body>
</html>